-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added: deleteNotification method which instantly removes notification… #56
base: master
Are you sure you want to change the base?
Conversation
…, rather than removeNotification() which applies animation. Useful when a loading and a success message follow each other in quick succession, as the loading notificaitons animation had not yet terminated, causing an odd slide in and down to occur
I really need this too |
Sorry the delay on this. @pollen8 can you doc this on README too? |
this.state.notifications.forEach(function(item, index) { | ||
if (item.uid === uid) { | ||
self.state.notifications.splice(index, 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must never ever edit the state
w/o setState
.
@igorprado Will this also be in the 1.0.0 version? Would be a great addition |
} | ||
}); | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you reuse getNotificationRef
from https://github.com/igorprado/react-notification-system/pull/89/files ?
…, rather than removeNotification() which applies animation. Useful when a loading and a success message follow each other in quick succession, as the loading notificaitons animation had not yet terminated, causing an odd slide in and down to occur